var status = -1;
var selectionLog = [];

function action(f, e, d) {
    if (status == 0 && f == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = d;
    var b = -1;
    if (status <= b++) {
        cm.dispose()
    } else {
        if (status === b++) {
            var a = [32663, 32664, 32665, 32698, 32990];
            var c = 0;
            for (var b = 0; b < a.length; b++) {
                if (cm.isQuestFinished(a[b])) {
                    c++
                }
            }
            cm.setNumberForQuestInfo(32666, "clear", c);
            cm.dispose()
        }
    }
}

function start() {
    status = -1;
    action(1, 0, 0)
};